<template>
	<article>
		<el-dialog title="" :visible.sync="bol" :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false" >
           <i class="el-icon-close close" @click="cancel" style="color: white;z-index: 99;"></i>
		 <div class="bt">权限设置</div>
			<!-- 默认展开 -->
			<!-- :default-expanded-keys="this.params.row.auth.split(',')" -->
			<div class="wrap">
					  				<el-checkbox-group v-model="checkList" class="">
											<div class="check">
												<span>报名缴费: </span>
												<div class="check1">
													<el-checkbox label="新生报名" class="check2">新生报名</el-checkbox>
													<el-checkbox label="老生缴费">老生缴费</el-checkbox>
													<el-checkbox label="补交费用">补交费用</el-checkbox>
													<el-checkbox label="退学管理">退学管理</el-checkbox>
												</div>
											</div>
											<div class="check">
												<span>班级管理: </span>
												<div class="check1">
										    <el-checkbox label="预设班级" class="check2">预设班级</el-checkbox>
										    <el-checkbox label="班级管理">班级管理</el-checkbox>
												</div>
											</div>
					  				<div class="check">
												<span>进销存管理: </span>
												<div class="check1">
										    <el-checkbox label="采购入库" class="check2">采购入库</el-checkbox>
										    <el-checkbox label="库存查询">库存查询</el-checkbox>
										    <el-checkbox label="领用与退领">领用与退领</el-checkbox>
										    <el-checkbox label="报损">报损</el-checkbox>
										    <el-checkbox label="盘点">盘点</el-checkbox>
										    <el-checkbox label="采购退货">采购退货</el-checkbox>
												</div>
									  </div>
					  				<div class="check">
												<span>学校后台设置: </span>
												<div class="check1">
										    <el-checkbox label="人事设置" class="check2">人事设置</el-checkbox>
										    <el-checkbox label="教室设置">教室设置</el-checkbox>
										    <el-checkbox label="节假日设置">节假日设置</el-checkbox>
										    <el-checkbox label="仓库设置">仓库设置</el-checkbox>
										    <el-checkbox label="物品设置">物品设置</el-checkbox>
										    <el-checkbox label="上课全校调整">上课全校调整</el-checkbox>
										    <el-checkbox label="课程价格设置">课程价格设置</el-checkbox>
										    <el-checkbox label="学校基本信息设置">学校基本信息设置</el-checkbox>
												</div>
									  </div>
					  				<div class="check">
												<span>财务设置: </span>
												<div class="check1">
										    <el-checkbox label="退费管理" class="check2">退费管理</el-checkbox>
										    <el-checkbox label="退费审核">退费审核</el-checkbox>
										    <el-checkbox label="老师课时结算">老师课时结算</el-checkbox>
										    <el-checkbox label="缴费审核">缴费审核*</el-checkbox>
												</div>
									 </div>
					  				<div class="check">
												<span>统计报表: </span>
												<div class="check1">
										    <el-checkbox label="收费统计" class="check2">收费统计</el-checkbox>
										    <el-checkbox label="休学名单">休学名单</el-checkbox>
										    <el-checkbox label="课销统计(学生)">课销统计(学生)</el-checkbox>
										    <el-checkbox label="老师上课统计">老师上课统计</el-checkbox>
										    <el-checkbox label="学生上课统计">学生上课统计</el-checkbox>
										    <el-checkbox label="财务报表">财务报表</el-checkbox>
										    <el-checkbox label="学生流失警报">学生流失警报</el-checkbox>
										    <el-checkbox label="老是课时统计">老是课时统计</el-checkbox>
												</div>
										</div>
							</el-checkbox-group>
			</div>
			<span slot="footer" class="dialog-footer">
		    	<el-button @click="cancel">取 消</el-button>
		    	<!-- <el-button  type="primary" @click="setCheckedKeys1">查看权限</el-button> -->
		    	<el-button type="primary" @click="getCheckedKeys">确 定</el-button>
		  	</span>
		</el-dialog>
	</article>
</template>

<script type="text/javascript">
	export default {
		props: ['params'],
		data() {
			return {
				bol: true,
				checkList:[],
			}
		},
		created () {
			// console.log(this.params.row.id)
			// console.log(this.params.row.auth)
			// console.log(this.params.row.auth.split(','))
			this.checkList = this.params.row.auth.split(',')
		},
		methods: {
			cancel() {
				this.$emit('close', {
					type: 'authority',
					cancel: true
				})
			},
			getCheckedKeys() {
				this.axios.get(this.$store.state.api+'ls/auth',{
					params:{
						id:this.params.row.id,
						auth:this.checkList+'',
					}
				}).then(res => {
					console.log(res)
					this.$emit('close', {
						type: 'authority',
						cancel: true
					})
				})
			}

		}
	}
</script>
<style lang="less" scoped>
.wrap{
	// margin-top: 20px;
}
.check{
	margin-top: 30px;
	span{
		text-align: right;
		width: 15%;
		height: 50px;
		margin-right: 20px;
		float: left;
	}
	.check1{
		width: 85%;
		text-align: left;
		.check2{
			margin-left: 15px;
		}
	}
}
.bt{
			position: absolute;
			width: 100%;
			height: 50px;
			margin: 0 auto;
			top:0;
			left:0;
			background: #50BFFF;
			margin-bottom: 20px;
			color:white;
			text-align:left;
			line-height: 50px;
			font-size: 17px;
			padding-left: 15px;
		}
		.tree{
			margin-top: 20px;
		}
</style>
